// 仓库相关类型
// 仓库相关类型
import type { BaseEntity, SelectOption, GitInstance } from '../common/base';
import type { QueryParams } from '../common/api';

export interface Repository extends BaseEntity {
  gitInstance: GitInstance;
  gitId: number;
  name: string;
  pathWithNamespace?: string;
  commitCount?: number;
  totalChanges?: number;
  allCommitCount?: number;
  allTotalChanges?: number;
}

export interface TopRepository {
  name: string;
  pathWithNamespace: string;
  commitCount: number;
  totalChanges: number;
}

export interface RepoValue {
  id: string;
  gitInstance: string;
  repositoryId: number;
  key: string;
}

export type RepoOption = SelectOption<RepoValue>;

export interface RepoQueryParams extends QueryParams {
  gitInstance?: GitInstance;
  name?: string;
}

export interface RepoStats {
  beijingRepoCount: number;
  chengduRepoCount: number;
  reposWithCommits: number;
  reposWithCommitsLastMonth: number;
}
